<template>
  <view class="wrap">
    <u-form :model="model" ref="uForm">
      <u-form-item label-width="150" label="姓名" prop="name">
        <u-input placeholder="请输入姓名" v-model="model.name" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="性别" prop="sex">
        <u-input placeholder="请输入性别" v-model="model.sex" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="年级" prop="grade">
        <u-input placeholder="请输入年级" v-model="model.grade" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="学院" prop="college">
        <u-input placeholder="请输入学院" v-model="model.college" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="专业" prop="specialize">
        <u-input placeholder="请输入专业" v-model="model.specialize" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="政治面貌" prop="polityMask">
        <u-input placeholder="请输入政治面貌" v-model="model.polityMask" type="text"></u-input>
      </u-form-item>
      <u-form-item :rightIconStyle="{color: '#888', fontSize: '32rpx'}" right-icon="kefu-ermai" label="手机号码"
        prop="phone" label-width="150">
        <u-input placeholder="请输入手机号" v-model="model.phone" type="number"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="QQ号码" prop="qq">
        <u-input placeholder="请输入QQ号" v-model="model.qq" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="意向组织" prop="org" class="soc">
        <u-input placeholder="请输入意向组织" v-model="model.org" type="text" @blur="search(model.org)"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="意向部门" prop="room" class="soc">
        <u-input placeholder="请输入意向部门" v-model="model.room" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="加入理由" prop="reason" class="soc">
        <u-input placeholder="请输入加入理由" v-model="model.reason" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="自我评价" prop="selfEvaluation" class="soc">
        <u-input placeholder="请输入自我评价" v-model="model.selfEvaluation" type="text"></u-input>
      </u-form-item>
      <u-form-item label-width="150" label="主要经历及曾获奖励" prop="experience" class="soc">
        <u-input placeholder="请输 入主要经历及曾获奖励" v-model="model.experience" type="text"></u-input>
      </u-form-item>
      <u-form-item label="照片" prop="photo" label-width="150">
        <u-image width="160" height="160" :src="model.photo"></u-image>
      </u-form-item>
    </u-form>
    <!-- <u-button @click="" class="btn" type="warning">导出个人文件</u-button> -->
  </view>
</template>

<script>
  export default {
    data() {
      return {
        id: '', //简历id
        model: {
          name: '',
          sex: '', //性别
          colleg: '', //学院
          specialize: '', //专业
          grade: '',
          study_store: '', //学号			
          polityMask: '', //政治面貌
          qq: '', //qq
          phone: '', //电话
          org: '', //组织
          room: '', //部门
          reason: '', //理由
          selfEvaluation: '', //自我评价
          experience: '', //经历
          photo: ''
        },
      }
    },
    onLoad(option) {
      //通过option.id获取这份简历的基本信息（组织报名表）
      console.log(option.id)
      this.$request({
        method: 'GET',
        url: '/getstuinfor',
        data: {
          id: option.id
        },
        header: {
          'Content-Type': 'application/x-www-form-urlencoded'
        },
      }).then(res => {
        console.log(res.data)
        console.log(this)
        this.model = res.data
        if (this.model.sex) {
          return this.model.sex = '男'
        }
        return this.model.sex = '女'
      }).catch(res => {
        console.log(res)
        // 失败后执行
        console.log('reserror')
      })
    },
    methods: {
      getInf() {

      },
      rules() {

      }
    }
  }
</script>

<style>
  .wrap {
    padding: 30rpx;
  }

  .agreement {
    display: flex;
    align-items: center;
    margin: 40rpx 0;

  }

  .agreement-text {
    padding-left: 8rpx;
    color: $u-tips-color;
  }

  .soc {}

  .btn,
  button {
    margin: 15rpx;
  }
</style>
